package cn.edu.xmu.restfuldemo.model;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author 22920192204242
 * @date 2021/10/14 16:51
 */
public class Orders implements VoObject{
    /**
     * 商品状态
     */
    public enum Status {
        UNPAIED(0,"未发布"),
        PAIED(1,"发布"),
        DELETED(2,"废弃");

        private static final Map<Integer, Orders.Status> stateMap;

        static { //由类加载机制，静态块初始加载对应的枚举属性到map中，而不用每次取属性时，遍历一次所有枚举值
            stateMap = new HashMap();
            for (Orders.Status enum1 : values()) {
                stateMap.put(enum1.code, enum1);
            }
        }

        private int code;
        private String description;

        Status(int code, String description) {
            this.code=code;
            this.description=description;
        }

        public static Orders.Status getStatusByCode(Integer code){
            return stateMap.get(code);
        }

        public Integer getCode(){
            return code;
        }

        public String getDescription() {return description;}

    }
    /**
     * 代理对象
     */
    private OrdersPo ordersPo;

    /**
     * 构造函数
     */
    public Orders() {
        this.ordersPo = new OrdersPo();
    }

    /**
     * 构造函数
     */
    public Orders(OrdersPo ordersPo) {
        this.ordersPo = ordersPo;
    }

    /**
     * 由Goods对象创建Vo对象
     */
    @Override
    public Object createVo(){
        return new OrdersRetVo(this);
    }

    /**
     * 获得内部的代理对象
     * @return GoodsPo对象
     */
    public OrdersPo gotOrdersPo(){
        return this.ordersPo;
    }



    private List<OrderItem> orderItemList;

    public List<OrderItem> getOrderItems() {
        return orderItemList;
    }

    public void setOrderItemList(List<OrderItem> OrderItemList) {
        this.orderItemList = OrderItemList;
    }

    @Override
    public int hashCode() {
        return ordersPo.hashCode();
    }

    @Override
    public String toString() {
        return ordersPo.toString();
    }

    @Override
    public boolean equals(Object o) {
        return ordersPo.equals(((Orders)o).ordersPo);
    }

    public Integer getId() {
        return ordersPo.getId();
    }

    public void setId(Integer id) {
        this.ordersPo.setId(id);
    }

    public Integer getCustomerId() {
        return ordersPo.getCustomerId();
    }

    public void setCustomerId(Integer customerId) {
        this.ordersPo.setCustomerId(customerId);
    }

    public Integer getCouponActivityId() {
        return ordersPo.getCouponActivityId();
    }


    public Integer getGrouponDiscount() {
        return ordersPo.getGrouponDiscount();
    }

    public Integer getShopId() {
        return ordersPo.getShopId();
    }

    public void setShopId(Integer shopId) {
        this.ordersPo.setShopId(shopId);
    }

    public String getOrderSn() {
        return ordersPo.getOrderSn();
    }

    public void setOrderSn(String orderSn) {
        this.ordersPo.setOrderSn(orderSn);
    }

    public Integer getPid() {
        return ordersPo.getPid();
    }

    public void setPid(Integer pid) {
        this.ordersPo.setPid(pid);
    }

    public String getConsignee() {
        return ordersPo.getConsignee();
    }

    public void setConsignee(String consignee) {
        this.ordersPo.setConsignee(consignee);
    }

    public Integer getRegionId() {
        return ordersPo.getRegionId();
    }

    public void setRegionId(Integer regionId) {
        this.ordersPo.setRegionId(regionId);
    }

    public String getAddress() {
        return ordersPo.getAddress();
    }

    public void setAddress(String address) {
        this.ordersPo.setAddress(address);
    }

    public String getMobile() {
        return ordersPo.getMobile();
    }

    public void setMobile(String mobile) {
        this.ordersPo.setMobile(mobile);
    }

    public String getMessage() {
        return ordersPo.getMessage();
    }

    public void setMessage(String message) {
        this.ordersPo.setMessage(message);
    }

    public Integer getOrderType() {
        return ordersPo.getOrderType();
    }

    public void setOrderType(Integer orderType) {
        this.ordersPo.setOrderType(orderType);
    }

    public Double getFreightPrice() {
        return ordersPo.getFreightPrice();
    }

    public void setFreightPrice(Double freightPrice) {
        this.ordersPo.setFreightPrice(freightPrice);
    }

    public Integer getCouponId() {
        return ordersPo.getCouponId();
    }

    public void setCouponId(Integer couponId) {
        this.ordersPo.setCouponId(couponId);
    }

    public String getDiscountPrice() {
        return ordersPo.getDiscountPrice();
    }

    public void setDiscountPrice(String discountPrice) {
        this.ordersPo.setDiscountPrice(discountPrice);
    }

    public Integer getOriginPrice() {
        return ordersPo.getOriginPrice();
    }

    public void setOriginPrice(Integer originPrice) {
        this.ordersPo.setOriginPrice(originPrice);
    }

    public Integer getPresaleId() {
        return ordersPo.getPresaleId();
    }

    public void setPresaleId(Integer presaleId) {
        this.ordersPo.setPresaleId(presaleId);
    }

    public Integer getGrouponId() {
        return ordersPo.getGrouponId();
    }

    public void setGrouponId(Integer grouponId) {
        this.ordersPo.setGrouponId(grouponId);
    }

    public Integer getRebateNum() {
        return ordersPo.getRebateNum();
    }

    public void setRebateNum(Integer rebateNum) {
        this.ordersPo.setRebateNum(rebateNum);
    }

    public String getConfirmTime() {
        return ordersPo.getConfirmTime();
    }

    public void setConfirmTime(String confirmTime) {
        this.ordersPo.setConfirmTime(confirmTime);
    }

    public String getShipmentSn() {
        return ordersPo.getShipmentSn();
    }

    public void setShipmentSn(String shipmentSn) {
        this.ordersPo.setShipmentSn(shipmentSn);
    }

    public Integer getState() {
        return ordersPo.getState();
    }

    public void setState(Integer state) {
        this.ordersPo.setState(state);
    }

    public Integer getSubState() {
        return ordersPo.getSubState();
    }

    public void setSubState(Integer subState) {
        this.ordersPo.setState(subState);
    }

    public Boolean getBeDeleted() {
        return ordersPo.getBeDeleted();
    }

    public void setBeDeleted(Boolean beDeleted) {
        this.ordersPo.setBeDeleted(beDeleted);
    }

    private List<OrderItem> orderItems;
    public List<OrderItem> getOrderIterms() {
        return orderItems;
    }

    public void setOrderIterms(List<OrderItem> orderItems) {
        this.orderItems=orderItems;
    }
    public String getGmtCreate() {
        return ordersPo.getGmtCreate();
    }

    public void setGmtCreate(String gmtCreate) {
        this.ordersPo.setGmtCreate(gmtCreate);
    }

    public String getGmtModified() {
        return ordersPo.getGmtModified();
    }

    public void setGmtModified(String gmtModified) {
        this.ordersPo.setGmtModified(gmtModified);
    }

}
